unit uDMPodmioty;

interface

uses
  SysUtils, Classes, uADStanIntf, uADStanOption, uADStanParam, uADStanError, uADDatSManager,
  uADPhysIntf, uADDAptIntf, uADStanAsync, uADDAptManager, DB, uADCompDataSet, uADCompClient,
  JvDataSource;

type
  TDMPodmioty = class(TDataModule)
    ADQRodzaje: TADQuery;
    ADQModyfikujKRS: TADQuery;
    ADQIdRodzajPodmiotu: TADQuery;
    ADQDodajKRS: TADQuery;
    ADQWydanieKRS: TADQuery;
    ADQUsunKRS: TADQuery;
    ADQDodaj: TADQuery;
    ADQPodmioty: TADQuery;
    procedure DataModuleCreate(Sender: TObject);
  private
    { Private declarations }
    ADConnection: TADConnection;
    ADTransaction: TADTransaction;
  public
    { Public declarations }

    constructor Create(Connection: TADConnection; Transaction: TADTransaction ; AOwner: TComponent);
  end;

//var
//  DMPodmioty: TDMPodmioty;

implementation

{$R *.dfm}

constructor TDMPodmioty.Create(Connection: TADConnection; Transaction: TADTransaction ; AOwner: TComponent);
begin
  inherited Create(AOwner);
  ADConnection := Connection;
  ADTransaction := Transaction;
  Name := '';
end;

procedure TDMPodmioty.DataModuleCreate(Sender: TObject);
var
  i : integer;
begin
  for i:=0 to Self.ComponentCount-1 do
  begin
    //przezroczysty TSpeedButton
    if Self.Components[i] is TADQuery then
    begin
      (Self.Components[i] as TADQuery).Connection := ADConnection;
      (Self.Components[i] as TADQuery).Transaction  := ADTransaction;
    end;
  end;
end;

end.
